Wear Levelling
   HOME

TheInfoList



OR:

Wear leveling (also written as wear levelling) is a technique Wear leveling techniques for flash memory systems. for prolonging the
service life A product's service life is its period of use in service. Several related terms describe more precisely a product's life, from the point of manufacture, storage, and distribution, and eventual use. Service life has been defined as "a product's ...
of some kinds of erasable
computer storage Computer data storage is a technology consisting of computer components and recording media that are used to retain digital data. It is a core function and fundamental component of computers. The central processing unit (CPU) of a compute ...
media, such as
flash memory Flash memory is an electronic non-volatile computer memory storage medium that can be electrically erased and reprogrammed. The two main types of flash memory, NOR flash and NAND flash, are named for the NOR and NAND logic gates. Both us ...
, which is used in
solid-state drive A solid-state drive (SSD) is a solid-state storage device that uses integrated circuit assemblies to store data persistently, typically using flash memory, and functioning as secondary storage in the hierarchy of computer storage. It is ...
s (SSDs) and
USB flash drive A USB flash drive (also called a thumb drive) is a data storage device that includes flash memory with an integrated USB interface. It is typically removable, rewritable and much smaller than an optical disc. Most weigh less than . Since firs ...
s, and
phase-change memory Phase-change memory (also known as PCM, PCME, PRAM, PCRAM, OUM (ovonic unified memory) and C-RAM or CRAM (chalcogenide RAM)) is a type of non-volatile random-access memory. PRAMs exploit the unique behaviour of chalcogenide glass. In PCM, heat pr ...
. There are several wear leveling mechanisms that provide varying levels of longevity enhancement in such memory systems. The term ''preemptive wear leveling'' (PWL) has been used by
Western Digital Western Digital Corporation (WDC, commonly known as Western Digital or WD) is an American computer drive manufacturer and data storage company, headquartered in San Jose, California. It designs, manufactures and sells data technology produc ...
to describe their preservation technique used on
hard disk drive A hard disk drive (HDD), hard disk, hard drive, or fixed disk is an electro-mechanical data storage device that stores and retrieves digital data using magnetic storage with one or more rigid rapidly rotating platters coated with magnet ...
s (HDDs) designed for storing audio and video data. However, HDDs generally are not wear-leveled devices in the context of this article.


Rationale

EEPROM EEPROM (also called E2PROM) stands for electrically erasable programmable read-only memory and is a type of non-volatile memory used in computers, usually integrated in microcontrollers such as smart cards and remote keyless systems, or as a ...
and flash memory media have individually erasable segments, each of which can be put through a limited number of erase cycles before becoming unreliable. This is usually around 3,000/5,000 cycles but many flash devices have one block with a specially extended life of 100,000+ cycles that can be used by the
Flash memory controller A flash memory controller (or flash controller) manages data stored on flash memory (usually NAND flash) and communicates with a computer or electronic device. Flash memory controllers can be designed for operating in low duty-cycle environments l ...
to track wear and movement of data across segments. Erasable
optical media In computing and optical disc recording technologies, an optical disc (OD) is a flat, usually circular disc that encodes binary data ( bits) in the form of pits and lands on a special material, often aluminum, on one of its flat surfaces ...
such as
CD-RW CD-RW (Compact Disc-Rewritable) is a digital media, digital optical disc data storage device, storage format introduced in 1997. A CD-RW compact disc (CD-RWs) can be written, read, erased, and re-written. CD-RWs, as opposed to CDs, require ...
and
DVD-RW DVD recordable and DVD rewritable are optical disc recording technologies. Both terms describe DVD optical discs that can be written to by a DVD recorder, whereas only 'rewritable' discs are able to erase and rewrite data. Data is written ('burne ...
are rated at up to 1,000 cycles (100,000 cycles for
DVD-RAM DVD-RAM (DVD Random Access Memory) is a DVD-based disc specification presented in 1996 by the DVD Forum, which specifies rewritable DVD-RAM media and the appropriate DVD writers. DVD-RAM media have been used in computers as well as camcorders an ...
media). Wear leveling attempts to work around these limitations by arranging data so that erasures and re-writes are distributed evenly across the medium. In this way, no single erase block prematurely fails due to a high concentration of write cycles. In flash memory, a single block on the chip is designed for longer life than the others so that the memory controller can store operational data with less chance of its corruption. Conventional
file system In computing, file system or filesystem (often abbreviated to fs) is a method and data structure that the operating system uses to control how data is stored and retrieved. Without a file system, data placed in a storage medium would be one larg ...
s such as
FAT In nutrition science, nutrition, biology, and chemistry, fat usually means any ester of fatty acids, or a mixture of such chemical compound, compounds, most commonly those that occur in living beings or in food. The term often refers spec ...
, UFS, HFS,
EXT Ext, ext or EXT may refer to: * Ext functor, used in the mathematical field of homological algebra * Ext (JavaScript library), a programming library used to build interactive web applications * Exeter Airport (IATA airport code), in Devon, England ...
, and
NTFS New Technology File System (NTFS) is a proprietary journaling file system developed by Microsoft. Starting with Windows NT 3.1, it is the default file system of the Windows NT family. It superseded File Allocation Table (FAT) as the preferred fil ...
were originally designed for magnetic disks and as such rewrite many of their data structures (such as their directories) repeatedly to the same area. When these systems are used on flash memory media, this becomes a problem. The problem is aggravated by the fact that some file systems track last-access times, which can lead to file
metadata Metadata is "data that provides information about other data", but not the content of the data, such as the text of a message or the image itself. There are many distinct types of metadata, including: * Descriptive metadata – the descriptive ...
being constantly rewritten in-place.


Types

There are three basic types of wear leveling mechanisms used in flash memory storage devices:


No wear leveling

A flash memory storage system with ''no wear leveling'' will not last very long if data is written to the flash. Without wear leveling, the underlying flash controller must permanently assign the logical addresses from the
operating system An operating system (OS) is system software that manages computer hardware, software resources, and provides common services for computer programs. Time-sharing operating systems schedule tasks for efficient use of the system and may also in ...
(OS) to the physical addresses of the flash memory. This means that every write to a previously written block must first be read, erased, modified, and re-written to the same location. This approach is very time-consuming and frequently written locations will wear out quickly, while other locations will not be used at all. Once a few blocks reach their end of life, such a device becomes inoperable.


Dynamic wear leveling

The first type of wear leveling is called ''dynamic wear leveling'' and it uses a map to link logical block addresses (LBAs) from the OS to the physical flash memory. Each time the OS writes replacement data, the map is updated so the original physical block is marked as ''invalid'' data, and a new block is linked to that map entry. Each time a block of data is re-written to the flash memory, it is written to a new location. However, flash memory blocks that never get replacement data would sustain no additional wear, thus the name comes only from the dynamic data being recycled. Such a device may last longer than one with no wear leveling, but there are blocks still remaining as active even though the device is no longer operable.


Static wear leveling

The other type of wear leveling is called ''static wear leveling'' which also uses a map to link the LBA to physical memory addresses. Static wear leveling works the same as dynamic wear leveling except the static blocks that do not change are periodically moved so that these low usage cells are able to be used by other data. This rotational effect enables an SSD to continue to operate until most of the blocks are near their end of life.


Global wear leveling

Both dynamic and static wear leveling are implemented at the local level. This simply means that in a multi-chip product, every chip is managed as a single resource. The number of defective blocks in different chips within a NAND flash memory varies: a given chip could have all its data blocks worn out while another chip in the same device could have all its blocks still active. Global wear leveling addresses this problem by managing all blocks from all chips in the flash memory together―in a single pool. It ensures that all the cells in all the chips within the product are worn out evenly.


Comparison

The following table compares static and dynamic wear leveling:


Techniques

There are several techniques for extending the media life: * A checksum or
error-correcting In information theory and coding theory with applications in computer science and telecommunication, error detection and correction (EDAC) or error control are techniques that enable reliable delivery of digital data over unreliable commun ...
code can be kept for each block or sector in order to detect errors or correct errors. * A pool of reserve space can also be kept. When a block or sector does fail, future reads and writes to it can be redirected to a replacement in that pool. * Blocks or sectors on the media can be tracked in a
least frequently used Least Frequently Used (LFU) is a type of cache algorithm used to manage memory within a computer. The standard characteristics of this method involve the system keeping track of the number of times a block is referenced in memory. When the cache i ...
(LFU) queue. The data structures for the queue itself must either be stored off-device or in such a way that the space it uses is itself wear-leveled or, in the case of flash memory, in a block with a specially extended life. However, usual
cache algorithms In computing, cache algorithms (also frequently called cache replacement algorithms or cache replacement policies) are optimizing instructions, or algorithms, that a computer program or a hardware-maintained structure can utilize in order to ma ...
are designed to manage the data flow into and out of
RAM Ram, ram, or RAM may refer to: Animals * A male sheep * Ram cichlid, a freshwater tropical fish People * Ram (given name) * Ram (surname) * Ram (director) (Ramsubramaniam), an Indian Tamil film director * RAM (musician) (born 1974), Dutch * ...
-based caches, making them not directly suitable for flash-based storage devices as they have an asymmetrical nature reads are usually much faster than writes, and erase operations can be performed only one "block" at a time. *
Garbage collection Waste collection is a part of the process of waste management. It is the transfer of solid waste from the point of use and disposal to the point of treatment or landfill. Waste collection also includes the curbside collection of recyclable m ...
On some
Secure Digital card Secure Digital, officially abbreviated as SD, is a proprietary non-volatile flash memory card format developed by the SD Association (SDA) for use in portable devices. The standard was introduced in August 1999 by joint efforts between SanDis ...
s, techniques are implemented in hardware by a built-in
microcontroller A microcontroller (MCU for ''microcontroller unit'', often also MC, UC, or μC) is a small computer on a single VLSI integrated circuit (IC) chip. A microcontroller contains one or more CPUs (processor cores) along with memory and programmable i ...
. On such devices, wear leveling is
transparent Transparency, transparence or transparent most often refer to: * Transparency (optics), the physical property of allowing the transmission of light through a material They may also refer to: Literal uses * Transparency (photography), a still, ...
, and conventional file systems can be used on them as-is. Wear leveling can also be implemented in software by special-purpose file systems such as
JFFS2 Journalling Flash File System version 2 or JFFS2 is a log-structured file system for use with flash memory devices. It is the successor to JFFS. JFFS2 has been included into the Linux kernel since September 23, 2001, when it was merged into the ...
and
YAFFS Yaffs (Yet Another Flash File System) is a file system designed and written by Charles Manning for the company Aleph One. Yaffs1 was the first version of this file system and was designed for the then-current NAND chips with 512 byte page size ( ...
on flash media or UDF on optical media. All three are
log-structured file system A log-structured filesystem is a file system in which data and metadata are written sequentially to a circular buffer, called a log. The design was first proposed in 1988 by John K. Ousterhout and Fred Douglis and first implemented in 1992 by Ou ...
s in that they treat their media as circular logs and write to them in sequential passes. File systems which implement
copy-on-write Copy-on-write (COW), sometimes referred to as implicit sharing or shadowing, is a resource-management technique used in computer programming to efficiently implement a "duplicate" or "copy" operation on modifiable resources. If a resource is dupl ...
strategies, such as
ZFS ZFS (previously: Zettabyte File System) is a file system with volume management capabilities. It began as part of the Sun Microsystems Solaris operating system in 2001. Large parts of Solaris – including ZFS – were published under an ope ...
, also implement a form of wear leveling.


See also

*
Flash file system A flash file system is a file system designed for storing files on flash memory–based storage devices. While flash file systems are closely related to file systems in general, they are optimized for the nature and characteristics of flash ...
*
Battery balancing Battery balancing and battery redistribution refer to techniques that improve the available capacity of a battery pack with multiple cells (usually in series) and increase each cell's longevity. A battery balancer or battery regulator is an ele ...


References


External links


Flash SSDs Inferior Technology or Closet Superstar?
bitmicro.com, archived from the original on February 2, 2007 {{DEFAULTSORT:Wear Leveling Computer memory Non-volatile memory Flash file systems Solid-state computer storage Balancing technology de:Wear-Leveling